package com.haorui.lygyd;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * @author 陈刚
 * @version 1.0
 * @project jxkf
 * @package com.haorui.jskf
 * @createDate 2018-01-31 15:42
 * @modfiyDate
 * @function
 */
@Slf4j
@SpringBootApplication
@ComponentScan(basePackages = { "com.haorui",
        "com.haorui.base",
        "com.haorui.lygyd.employeemanager",
        "com.haorui.sms",
        "com.haorui.email",
        "com.haorui.lygyd.wxapi",
        "com.haorui.fileserver"})
@EnableJpaRepositories(basePackages = {"com.haorui",
        "com.haorui.base",
        "com.haorui.lygyd.employeemanager",
        "com.haorui.sms",
        "com.haorui.email",
        "com.haorui.lygyd.wxapi",
        "com.haorui.fileserver"})
@EntityScan(basePackages = {"com.haorui",
        "com.haorui.base",
        "com.haorui.lygyd.employeemanager.entity",
        "com.haorui.lygyd.payordermanager",
        "com.haorui.sms",
        "com.haorui.email",
        "com.haorui.lygyd.wxapi",
        "com.haorui.fileserver"})
@EnableCaching
public class LYGYDMainApplication {

    public static void main(String[] args) {
        //todo 配置文件读取
        Environment env = SpringApplication.run(LYGYDMainApplication.class, args).getEnvironment();
        log.info("\n----------------------------------------------------------\n\t" +
                        "Application '{}' is running! Access URLs:\n\t" +
                        "Local: \t\thttp://localhost:{}\n----------------------------------------------------------",
                env.getProperty("spring.application.name"),
                env.getProperty("server.port"));
    }
}
